import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _Form from "antd/lib/form";
import React from "react";
import { ConfigStepContainer, StyledConfigRow } from "./index.style";
import TimeLineConfig from "../ComponentsConfig/TimeLineConfig";
import TabConfig from "../ComponentsConfig/TabConfig";
import TableConfig from "../ComponentsConfig/TableConfig";
import PopconfirmConfig from "../ComponentsConfig/PopconfirmConfig";
import ProgressConfig from "../ComponentsConfig/ProgressConfig";
import StepsConfig from "../ComponentsConfig/StepConfig";
import LoadingConfig from "../ComponentsConfig/LoadingConfig";

var ConfigStepFour = function ConfigStepFour(_ref) {
  var form = _ref.form,
      config = _ref.config;
  var getFieldDecorator = form.getFieldDecorator;
  return React.createElement(ConfigStepContainer, null, React.createElement(StyledConfigRow, null, getFieldDecorator("timeline", {
    initialValue: config.timeline
  })(React.createElement(TimeLineConfig, null))), React.createElement(StyledConfigRow, null, getFieldDecorator("tabs", {
    initialValue: {
      tabs: config.tabs,
      tabsCard: config.tabsCard
    }
  })(React.createElement(TabConfig, null))), React.createElement(StyledConfigRow, null, getFieldDecorator("table", {
    initialValue: config.table
  })(React.createElement(TableConfig, null))), React.createElement(StyledConfigRow, null, getFieldDecorator("popconfirm", {
    initialValue: {
      popconfirm: config.popconfirm,
      modal: config.modal
    }
  })(React.createElement(PopconfirmConfig, null))), getFieldDecorator("progress", {
    initialValue: {
      lineProgress: config.lineProgress,
      circleProgress: config.circleProgress
    }
  })(React.createElement(ProgressConfig, null)), React.createElement(StyledConfigRow, null, getFieldDecorator("steps", {
    initialValue: config.steps
  })(React.createElement(StepsConfig, null))), React.createElement(StyledConfigRow, null, getFieldDecorator("spin", {
    initialValue: config.spin
  })(React.createElement(LoadingConfig, null))));
};

export default _Form.create({
  onValuesChange: function onValuesChange(props, field, values) {
    if (props.onChange) {
      var popconfirm = values.popconfirm,
          progress = values.progress,
          tabs = values.tabs,
          rest = _objectWithoutProperties(values, ["popconfirm", "progress", "tabs"]);

      props.onChange(_objectSpread({}, rest, {}, popconfirm, {}, progress, {}, tabs));
    }
  }
})(ConfigStepFour);
